<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Session;
use App\Http\Controllers\OrderController;

class PaymentController extends Controller
{
    public function showPayForm(Request $request){
        $pay_info = Session::get('pay_info');
        return view('pay', ['payinfo' => $pay_info]);
    }

    public function pay(Request $request){
        // payment complete
        // should back to order controller
        return redirect()->route('saveOrder');
    }

    public function cancel(Request $request){
        session()->forget('pay_info');
        return redirect()->route('home');
    }
}
